home *** CD-ROM | disk | FTP | other *** search
- Path: news.NetVision.net.il!news
- From: koz@netvision.net.il
- Newsgroups: comp.lang.c++,comp.lang.c
- Subject: Re: Increasing stack size - HELP!
- Date: Sun, 25 Feb 96 00:23:09 PDT
- Organization: NetVision LTD.
- Message-ID: <NEWTNews.825237165.25683.koz@dialup.netvision.net.il>
- References: <4gcd0h$8rf@izar.brunel.ac.uk>
- NNTP-Posting-Host: ts006p3.pop3a.netvision.net.il
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; charset=US-ASCII
- X-Newsreader: NEWTNews & Chameleon -- TCP/IP for MS Windows from NetManage
-
-
- In Article<4gcd0h$8rf@izar.brunel.ac.uk>, <mapgfgf@brunel.ac.uk> write:
- > Path:
- news.NetVision.net.il!psinntp!psinntp!psinntp!howland.reston.ans.net!tank.news.
- pipex.net!pipex!sunsite.doc.ic.ac.uk!nntp0.brunel.ac.uk!usenet
- > From: Francesco Fantauzzi <mapgfgf@brunel.ac.uk>
- > Newsgroups: comp.lang.c++,comp.lang.c
- > Subject: Increasing stack size - HELP!
- > Date: 20 Feb 1996 11:58:09 GMT
- > Organization: Brunel University
- > Lines: 18
- > Message-ID: <4gcd0h$8rf@izar.brunel.ac.uk>
- > NNTP-Posting-Host: maths-pc-125.brunel.ac.uk
- > Mime-Version: 1.0
- > Content-Type: text/plain; charset=us-ascii
- > Content-Transfer-Encoding: 7bit
- > X-Mailer: Mozilla 1.22 (Windows; I; 16bit)
- > Xref: news.NetVision.net.il comp.lang.c++:5178 comp.lang.c:4340
- >
- > Hi All!
- >
- > I'm using Borland C++ 4.0. I'm stuck 'cause, when I run my program, it
- > stops with a run-time error: "STACK OVERFLOW!".
- >
- > I checked the stack size (with stackavail()) and it's actually too small.
- > How can I tell the compiler that I would like a larger stack, overriding
- > the default size? I'm sure there's a way: I did it years ago, but have
- > forgotten it.
- >
- > BTW, I'm writing a plain MS-DOS application with the compact memory
- > model.
- >
- > Thanks for any help.
- >
- > Francesco G. Fantauzzi
- >
- >
- Just use the next line :
-
- extern unsigned _stklen = NewStackSize;
-
- (It should be writen in the global section of the program, not in
- ANY procedure).
-
- Set the NewStackSize to the needed space.
-
- Its default is 4k. its minimum is 128 bytes, and the maximum depends on your
- model, in your compact model :
- Stack+Static Data should not exceed 64k.
-
- Check out the help file, dealing with global vars for more info.
-
- bye, Saar.
-
-